<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="/plantillas/defaultTemplate.xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core">
    <!-- ===================================================================================================== -->
    <ui:define name="titulo">
        <h:outputText value="Reporte de evaluaci&oacute;n"/>
    </ui:define>
    <!-- ===================================================================================================== -->
    <ui:define name="acciones">
        <p:tab title="Evaluaci&oacute;n">
            <h:panelGrid columns="1" width="100%" border="0" cellpadding="0" cellspacing="0">
                <p:commandLink styleClass="opcionMenu" action="#{empleados$reporteEvaluacion.mostrarReporteEvaluacion$action}" update="principalForm:mensajes" onmouseover="this.className='opcionMenu  textonegrita';" onmouseout="this.className='opcionMenu  textonormal';" ajax="false">
                    <p:graphicImage value="/resources/iconos/view-pim-journal.png"/>
                    <h:outputText value="Mostrar reporte" styleClass="espacioTexto"/>
                </p:commandLink>
            </h:panelGrid>
        </p:tab>  
        <p:tab title="Otras acciones">
            <h:panelGrid columns="1">
                <p:commandLink styleClass="opcionMenu textoNormal" ajax="true" action="#{empleados$reporteEvaluacion.inicio$action}" update="principalForm:mensajes" onmouseover="this.className='opcionMenu  textonegrita';" onmouseout="this.className='opcionMenu  textonormal';">
                    <p:graphicImage value="/resources/iconos/application-exit.png"/>
                    <h:outputText value="Cancelar" styleClass="espacioTexto"/>
                </p:commandLink>
            </h:panelGrid>
        </p:tab>
    </ui:define>
    <!-- ===================================================================================================== -->
    <ui:define name="contenido">        
        <p:fieldset id="fieldset1" legend="Reporte de evaluaci&oacute;n">
            <table width="100%">
                <tr valign="top">
                    <td colspan="2">
                        <p:dataList id="campaniasDataList"  value="#{empleados$reporteEvaluacion.listaCampanias}" var="campania" paginator="true" rows="3" effectSpeed="fast" paginatorAlwaysVisible="true" paginatorPosition="top" paginatorTemplate="Campa&ntilde;a {PreviousPageLink} {CurrentPageReport} {NextPageLink}" itemType="none"  >
                            <p:column>  
                                <p:commandLink title="Seleccionar campa&ntilde;a: #{campania.nomCampania}" style="text-decoration: none;" update="principalForm:mensajes,principalForm:tablaEmpleados,principalForm:campaniasDataList,principalForm:fieldset1" onmouseover="this.className='textonegrita';" onmouseout="this.className='textonormal';" >
                                    <p:graphicImage value="/resources/iconos/task-delegate.png"/>
                                    <h:outputText value="#{campania.nomCampania} (del " style="margin-left: 10px;"/>
                                    <h:outputText value="#{campania.fechaInicial}">
                                        <f:convertDateTime pattern="dd/MM/yyyy"/>
                                    </h:outputText>
                                    <h:outputText value="al "/>
                                    <h:outputText value="#{campania.fechaFinal}">
                                        <f:convertDateTime pattern="dd/MM/yyyy"/>
                                    </h:outputText>                                
                                    <h:outputText value=")"/>
                                    <f:setPropertyActionListener value="#{campania}" target="#{empleados$reporteEvaluacion.campaniaSeleccionada}" />
                                </p:commandLink>                        
                            </p:column>
                        </p:dataList>
                    </td>
                </tr>
            </table>
        </p:fieldset>
        <p:spacer height="5"/>
        <p:dataTable id="tablaEmpleados" value="#{empleados$reporteEvaluacion.listaEvaluaciones}" var="evaluacion" selectionMode="single" rows="5" paginator="true" paginatorAlwaysVisible="true" update="seleccionEvaluacionForm:tablaEmpleados" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,25,50,100" selection="#{empleados$reporteEvaluacion.evaluacionSeleccionada}">
            <f:facet name="header">
                <h:outputText value="Evaluaciones"/>
            </f:facet>
            <p:column headerText="Tipo evaluacion">
                <h:outputText value="#{evaluacion.plantilla1.tipoEvaluacion.nomTipoEvaluacion}"/>
            </p:column>     
            <p:column headerText="Fecha">
                <h:outputText value="#{evaluacion.fecha}">
                    <f:convertDateTime type="date" pattern="dd/MM/yyyy"/>
                </h:outputText>
            </p:column>
            <p:column headerText="Empleado" filterBy="#{evaluacion.empleados.nombreCompleto}" filterMatchMode="contains">
                <h:outputText value="#{evaluacion.empleados.nombreCompleto}"/>
            </p:column>       
        </p:dataTable>
    </ui:define>
    <!-- ===================================================================================================== -->
    <ui:define name="dialogos"/>
    <!-- ===================================================================================================== -->
</ui:composition>
